package com.baizhi.controller;


import com.baizhi.service.CmfzLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

@Controller
@RequestMapping("/log")
public class CmfzLogController {
    @Autowired
    private CmfzLogService cmfzLogService;

    @RequestMapping("/selectLogDatagrid")
    @ResponseBody
    public Map selectLogDatagrid(int page, int rows){
        return cmfzLogService.selectLogDatagrid(page,rows);
    }

    @RequestMapping("/deleteLogs")
    @ResponseBody
    public Map deleteLogs(int[] ids){
        Map map=new HashMap();
        try {
            cmfzLogService.deleteLogs(ids);
            map.put("isDelete",true);
        } catch (Exception e) {
            e.printStackTrace();
            map.put("isDelete",false);
        }
        return map;
    }
}
